package com.dayuanit.mall.bank.payenum;

import com.dayuanit.mall.bank.exception.MallBusException;

/**
 * 支付订单枚举
 * @author Administrator
 *
 */
public enum PayOrderEnum {
	
UNPAID(0, "未支付"), ALREADY_PAID(1, "已支付"), PAY_FAILURE(2, "支付失敗"), PAY_INVALID(3, "订单失效"), PAY_ING(4, "支付中");
	
	private int status;
	private String msg;
	
	private PayOrderEnum(int status, String msg) {
		this.status = status;
		this.msg = msg;
	}
	
	public static PayOrderEnum getPayStatus(int status) {
		
		for (PayOrderEnum ps : PayOrderEnum.values()) {
			if (ps.getStatus() == status) {
				return ps;
			}
		}
		
		throw new MallBusException("无效的订单状态");
	}

	public int getStatus() {
		return status;
	}

	public String getMsg() {
		return msg;
	}

}
